import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from 'midwayjs-cool-core';
import { Column, PrimaryGeneratedColumn } from 'typeorm';

@EntityModel('customer_cart')
export class CustomerCartEntity extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  // 外键：需要更新 customer 的 cart
  @Column({ comment: 'ManyToOne: cart => customer' })
  customerId: number;

  @Column({ comment: '商品 id' })
  productId: number;

  @Column({ comment: 'sku id' })
  skuId: number;

  @Column({ comment: '数量' })
  count: number;

  // SKU 信息：通过联表查询添加
  // 总价：可通过计算字段生成
}
